<?php if(!empty($productos)):?>

<div class="widget">
            <table cellpadding="0" cellspacing="0" width="100%" class="tDark">
                <thead>
                    <tr>
                        <td>Codigo</td>
                        <td>Nombre</td>
                        <td>Micaje</td>
                        <td>Alto</td>
                        <td>Peso</td>
                        <td>Sucursal</td>
                    </tr>
                </thead>
                <tbody>
                    <?php  $i = 0;  ?>
                <?php foreach ($productos as $pro):$i++;  ?>
                
                <tr id="redirecpro<?php echo $pro['Cortestubo']['id'];?>">
                    
                    <td><?php echo $pro['Cortestubo']['codigo']; ?></td>
                    <td><?php echo $pro['Tubo']['nombre']; ?></td>
                    <td><?php echo $pro['Tubo']['micraje']; ?></td>
                    <td ><?php echo $pro['Cortestubo']['alto']; ?></td>
                    <td ><?php echo $pro['Cortestubo']['peso']; ?></td>
                    <td><?php echo $pro['Sucursale']['nombre']; ?></td>
                </tr>
                <?php if($sw == 1):?>
                <?php 
                
                                            $this->Js->get('#redirecpro'.$pro['Cortestubo']['id'])->event(
                                            'click',
                                            'window.location.assign("'.$this->Html->url(array('controller'=>'Ventasproductos','action' => 'transferencias',$idventa,$pro['Cortestubo']['id']), true).'")'
                                            );?>
                <?php else:?>
                <?php 
                
                                            $this->Js->get('#redirecpro'.$pro['Cortestubo']['id'])->event(
                                            'click',
                                            'window.location.assign("'.$this->Html->url(array('controller'=>'Ventasproductos','action' => 'index',$idCliente,$idventa,$pro['Cortestubo']['id']), true).'")'
                                            );?>
                <?php endif;?>
                
            <?php endforeach; ?>
            
                </tbody>
            </table>
        
        </div>
        

<?php else:?>
<h3 style="color: red;">NO SE ENCONTRO RESULTADOS</h3>
<?php endif;?>
<?php echo $this->Js->writeBuffer(); ?>